package cn.netshop.pojo.;

import com.alibaba.fastjson.JSONObject;

/**
 * tb_category_brand实体类
 * 
 * @author 
 *
 */
public class TbCategoryBrand {
	/**分类ID*/
	private Integer categoryId; 
	/**品牌ID*/
	private Integer brandId; 
	/**
	 * 实例化
	 */
	public TbCategoryBrand() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */
	public TbCategoryBrand(JSONObject obj) {
		this();
		if (obj.get("categoryId") instanceof Number) {
			this.setCategoryId(((Number) obj.get("categoryId")).intValue());
		}
		if (obj.get("brandId") instanceof Number) {
			this.setBrandId(((Number) obj.get("brandId")).intValue());
		}
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getCategoryId() != null) {
			result.put("categoryId",this.getCategoryId());
		}
		if (this.getBrandId() != null) {
			result.put("brandId",this.getBrandId());
		}
		return result;
	}
	
	
	/**
	 * 获取categoryId
	 * 
	 * @return
	 */
	public Integer getCategoryId() {
		return categoryId;
	}

	/**
	 * 设置categoryId
	 * 
	 * @param categoryId
	 */
	public void setCategoryId(Integer categoryId) {
		this.categoryId = categoryId;
	}
	
	/**
	 * 获取brandId
	 * 
	 * @return
	 */
	public Integer getBrandId() {
		return brandId;
	}

	/**
	 * 设置brandId
	 * 
	 * @param brandId
	 */
	public void setBrandId(Integer brandId) {
		this.brandId = brandId;
	}

	@Override
	public String toString() {
		return "TbCategoryBrand [categoryId=" + categoryId + " , brandId=" + brandId + "  ]";
	
	}
	
	
}
